package com.company.cloud.product.modules.api.service;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.product.modules.api.fallback.ProductRemoteServiceFallbackFactory;
import com.company.cloud.product.modules.api.request.ProductQuery4PageRequest;
import com.company.cloud.product.modules.api.request.ProductQueryRequest;
import com.company.cloud.product.modules.api.response.Product;
import com.company.cloud.product.modules.api.response.ProductQuery4PageResponse;
import com.company.cloud.product.modules.api.response.ProductSimple;
import com.company.cloud.product.modules.api.response.Sku;
import com.company.common.server.constant.ServiceNameConstant;


@FeignClient(contextId = "prd1", name = ServiceNameConstant.prd_center, fallbackFactory =ProductRemoteServiceFallbackFactory.class)
public interface ProductRemoteService {
	
	
	@RequestMapping(value = "/remote/prd/prdById", method = RequestMethod.GET)
	public BaseClientResult<Product> getProductById(@RequestParam("productNo") String productNo);
	
	@RequestMapping(value = "/remote/prd/getProductMapByIds", method = RequestMethod.POST)
	public BaseClientResult<Map<String, Product>> getProductMapByIds(@RequestBody Set<String> productNos);
	
	@RequestMapping(value = "/remote/prd/getProductListByIds", method = RequestMethod.POST)
	public BaseClientResult<List<Product>> getProductListByIds(@RequestBody Set<String> productNos);
	
	@RequestMapping(value = "/remote/prd/prdByDbById", method = RequestMethod.GET)
	public BaseClientResult<Product> getProductByDbById(@RequestParam("productNo") String productNo);
	
	@RequestMapping(value = "/remote/prd/getProductMapByDbByIds", method = RequestMethod.POST)
	public BaseClientResult<Map<String, Product>> getProductMapByDbByIds(@RequestBody Set<String> productNos);
	
	@RequestMapping(value = "/remote/prd/getProductListByDbByIds", method = RequestMethod.POST)
	public BaseClientResult<List<Product>> getProductListByDbByIds(@RequestBody Set<String> productNos);
	
	
	@RequestMapping(value = "/remote/prd/simplePrdById", method = RequestMethod.GET)
	public BaseClientResult<ProductSimple> getProductSimpleById(@RequestParam("productNo") String productNo);
	
	@RequestMapping(value = "/remote/prd/getProductSimpleMapByIds", method = RequestMethod.POST)
	public BaseClientResult<Map<String, ProductSimple>> getProductSimpleMapByIds(@RequestBody Set<String> productNos);
	
	@RequestMapping(value = "/remote/prd/getProductSimplListByIds", method = RequestMethod.POST)
	public BaseClientResult<List<ProductSimple>> getProductSimplListByIds(@RequestBody Set<String> productNos);
	
	@RequestMapping(value = "/remote/prd/simplePrdByDbById", method = RequestMethod.GET)
	public BaseClientResult<ProductSimple> getProductSimpleByDbById(@RequestParam("productNo") String productNo);
	
	@RequestMapping(value = "/remote/prd/getProductSimpleMapByDbByIds", method = RequestMethod.POST)
	public BaseClientResult<Map<String, ProductSimple>> getProductSimpleMapByDbByIds(@RequestBody Set<String> productNos);
	
	@RequestMapping(value = "/remote/prd/getProductSimplListByDbByIds", method = RequestMethod.POST)
	public BaseClientResult<List<ProductSimple>> getProductSimplListByDbByIds(@RequestBody Set<String> productNos);
	
	
	@RequestMapping(value = "/remote/prd/queryProductSimpleInfo", method = RequestMethod.POST)
	public BaseClientResult<List<Product>> queryProductSimple(@RequestBody ProductQueryRequest request);
	
	@RequestMapping(value = "/remote/prd/queryProductSimple4Page", method = RequestMethod.POST)
	public BaseClientResult<ProductQuery4PageResponse> queryProductSimple4Page(@RequestBody ProductQuery4PageRequest request);
	
	
	
	@RequestMapping(value = "/remote/prd/getSkuMapByNos", method = RequestMethod.POST)
	public BaseClientResult<Map<String, Sku>> getSkuMapByNos(@RequestBody Set<String> skuNos);
	
	@RequestMapping(value = "/remote/prd/getSkuMapByCacheByNos", method = RequestMethod.POST)
	public BaseClientResult<Map<String, Sku>> getSkuMapByCacheByNos(@RequestBody Set<String> skuNos);
	
	@RequestMapping(value = "/remote/prd/getSkuMapByDbByNos", method = RequestMethod.POST)
	public BaseClientResult<Map<String, Sku>> getSkuMapByDbByNos(@RequestBody Set<String> skuNos);
	
	
	
	
	
}
